<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/25 0025
 * Time: 下午 5:32
 */

namespace App\Http\Controllers;


use DB;
use Illuminate\Http\Request;

class IndexController
{
    function index(){
        return view('index/index');
    }

    function taobao(Request $req){
        $cond = [];
        $conn = DB::table('goods_taobao');
        if($req->get('search')){
            $search = $req->get('search');
            $conn->where('goods_name', 'like', $search.'%')
                ->orWhere('cate', 'like', $search.'%');
        }
        $goods_taobao = $conn->paginate(15);
        return [
            "code"=>0,
            "message"=>"success",
            'data'=>$goods_taobao
        ];
    }
}